<?
$answer = $this->answer;
?>

<? if ($answer): ?>

<? if (!empty($answer['img'])): ?>
    <a href="<?= $answer['img'] ?>" target="_blank"> <img src="<?= $answer['img'] ?>" alt="<?= $answer['img'] ?>"/></a>
    <? endif; ?>

<form method="post" enctype="multipart/form-data" action="/photo/add">
    <input type="hidden" name="answer" value="<?= $answer['id'] ?>"/>
    <input type="file" name="img"/>
    <input type="submit" value="Update"/>
</form>

<? else: ?>
<h2>Answer with this id does not exist.</h2>
<? endif; ?>